<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
      // 1. 封装函数，求得数组中的最大值  [1, 6, 2, 8, 11, 5]
      function getMax(arr) {
       return Math.max(...arr)
      }
      let arr = [1, 6, 2, 8, 11, 5]
      let max = getMax(arr)
      console.log(max);
  </script>
</body>
</html>